<?php defined('ABSPATH') or die("No script kiddies please!");?>
<?php get_header(); ?>
	<?php if ( have_posts() ) : ?>
		<?php $catInfo = ap_get_category_slugs(); ?>
		<header id="page-header">
			<h1 class="page-title"><?php echo single_cat_title('') ?></h1>
			<?php
				// show category description, if exist
				$term_description = term_description();
				if ( ! empty( $term_description ) ) :
					printf( '<div class="page-description">%s</div>', $term_description );
				endif;
			?>
		</header>
		<!-- Khu vực nội dung chính -->
		<div class="panel " id="category">
			
			<div id="featured-list" class='content-panel'>
				<?php ap_get_posts('block-layout',array('featured'=>true,'limit'=>4,'orderby'=>'post-level','order'=>'ASC','categories'=>$catInfo)); ?>
			</div>
			<div id="main-list" class='content-panel'>
				<!-- Nav tabs -->
				<ul class="nav nav-tabs" role="tablist">
					<li role="presentation" class="active">
						<a href="#list-latest" role="tab" data-toggle="tab"><span class="ti-time"></span> Tin mới</a>
					</li>
					<li role="presentation">
						<a href="#list-pictures" role="tab" data-toggle="tab"><span class="ti-gallery"></span> Bài ảnh</a>
					</li>
					<li role="presentation">
						<a href="#list-video" role="tab" data-toggle="tab"><span class="ti-video-camera"></span> Video</a>
					</li>
				</ul>
				<!-- Tab panes -->
				<div class="tab-content">
					<div role="tabpanel" class="tab-pane active" id="list-latest">
						<?php
						while ( have_posts() ) {
							the_post();
							ap_render_post('list-layout');
						}
						ap_pagination();
						?>
						<!-- <?php ap_get_posts('list-layout',array('orderby'=>'date','order'=>'DESC','categories'=>$catInfo)); ?> -->
					</div>
					<div role="tabpanel" class="tab-pane" id="list-pictures">
						<?php ap_get_posts('list-layout',array('orderby'=>'date','order'=>'DESC','formats'=>'post-format-gallery','categories'=>$catInfo)); ?>
					</div>
					<div role="tabpanel" class="tab-pane" id="list-video">
						<?php ap_get_posts('list-layout',array('orderby'=>'date','order'=>'DESC','formats'=>'post-format-video','categories'=>$catInfo)); ?>
					</div>
				</div>
			</div>
			<div id="main-sidebar" class="sidebar-panel">
				<section class="widget" id="mostview-widget">
					<header class='widget-header'>
						<h1><a href="#">Xem nhiều nhất</a></h1>
					</header>
					<div class='widget-content'>
						<?php ap_get_posts('list-layout',array('limit'=>10,'orderby'=>'views','order'=>'DESC','categories'=>$catInfo)); ?>
					</div>
				</section>
				<div class="banner size-160x600 scrollfixed">
					<object type="application/x-shockwave-flash" data="http://media.adtimaserver.vn/2014/11/286daa2c-0e62-453d-8503-972eb3d10348.swf" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width="160" height="600"><param name="movie" value="http://media.adtimaserver.vn/2014/11/286daa2c-0e62-453d-8503-972eb3d10348.swf"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="opaque"><param name="FlashVars" value="clickTARGET=_blank&amp;zid=2405389651443931836&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DC6VavZri3Tt_5g18RXQNeqA1q5mjYiSbzW0jdZpPD4UDIpsFwRp7PBApptdN_k1ezVJ8mVkUBesbNuLGan2M_Tz3q2_ChitYNrGvhsNo_3y65O0inx-87xjew4DDFW5HrNCoB782HRxBa7h2N6fVh84Vysw%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fwww.giaydathethao.com"><embed width="160" height="600" flashvars="clickTARGET=_blank&amp;zid=2405389651443931836&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DC6VavZri3Tt_5g18RXQNeqA1q5mjYiSbzW0jdZpPD4UDIpsFwRp7PBApptdN_k1ezVJ8mVkUBesbNuLGan2M_Tz3q2_ChitYNrGvhsNo_3y65O0inx-87xjew4DDFW5HrNCoB782HRxBa7h2N6fVh84Vysw%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fwww.giaydathethao.com" allowscriptaccess="always" wmode="opaque" quality="high" name="ZingAds" id="ZingAds" src="http://media.adtimaserver.vn/2014/11/286daa2c-0e62-453d-8503-972eb3d10348.swf" type="application/x-shockwave-flash"><a href="http://api.adtimaserver.vn/track/click?params=C6VavZri3Tt_5g18RXQNeqA1q5mjYiSbzW0jdZpPD4UDIpsFwRp7PBApptdN_k1ezVJ8mVkUBesbNuLGan2M_Tz3q2_ChitYNrGvhsNo_3y65O0inx-87xjew4DDFW5HrNCoB782HRxBa7h2N6fVh84Vysw&amp;uid=96635b89-dbe5-4d3a-aeac-2755ff213ae0&amp;redirectUrl=http%3A%2F%2Fwww.giaydathethao.com" target="_blank"><img src="http://media.adtimaserver.vn/2014/11/edae200a-71cc-435d-8b34-0407795be147.jpg" style="position:absolute; left: 0; top: 0;"></a></object>
				</div>
			</div>
			<div class="aside-panel">
				<div class="banner size-300x600">
					<object type="application/x-shockwave-flash" data="http://media.adtimaserver.vn/2014/11/53a4b1b3-2f98-47e1-973f-cb1737d5f1c0.swf" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width="300" height="600"><param name="movie" value="http://media.adtimaserver.vn/2014/11/53a4b1b3-2f98-47e1-973f-cb1737d5f1c0.swf"><param name="AllowScriptAccess" value="always"><param name="quality" value="High"><param name="wmode" value="opaque"><param name="FlashVars" value="clickTARGET=_blank&amp;zid=1875626867369138608&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DVfus7Xpi3TshROXsBfQNJBYt-1kjYnoxwTVj9ZoRTW0jYpsFnzzDq9eCxJZ12tgx4oWBSJi84SZz0bzDaFWcHeLd93_iBy8sJBhpgo56SK76tDHq-0uKGLrS5iP8ZYNql29eDw8Axmp0vhdJmJ0bXR6OCCgw%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fzing.vn%252Ffashionista"><embed width="300" height="600" flashvars="clickTARGET=_blank&amp;zid=1875626867369138608&amp;clickTAG=http%3A%2F%2Fapi.adtimaserver.vn%2Ftrack%2Fclick%3Fparams%3DVfus7Xpi3TshROXsBfQNJBYt-1kjYnoxwTVj9ZoRTW0jYpsFnzzDq9eCxJZ12tgx4oWBSJi84SZz0bzDaFWcHeLd93_iBy8sJBhpgo56SK76tDHq-0uKGLrS5iP8ZYNql29eDw8Axmp0vhdJmJ0bXR6OCCgw%26uid%3D96635b89-dbe5-4d3a-aeac-2755ff213ae0%26redirectUrl%3Dhttp%253A%252F%252Fzing.vn%252Ffashionista" allowscriptaccess="always" wmode="opaque" quality="high" name="ZingAds" id="ZingAds" src="http://media.adtimaserver.vn/2014/11/53a4b1b3-2f98-47e1-973f-cb1737d5f1c0.swf" type="application/x-shockwave-flash"><a href="http://api.adtimaserver.vn/track/click?params=Vfus7Xpi3TshROXsBfQNJBYt-1kjYnoxwTVj9ZoRTW0jYpsFnzzDq9eCxJZ12tgx4oWBSJi84SZz0bzDaFWcHeLd93_iBy8sJBhpgo56SK76tDHq-0uKGLrS5iP8ZYNql29eDw8Axmp0vhdJmJ0bXR6OCCgw&amp;uid=96635b89-dbe5-4d3a-aeac-2755ff213ae0&amp;redirectUrl=http%3A%2F%2Fzing.vn%2Ffashionista" target="_blank"><img src="http://media.adtimaserver.vn/2014/11/f84171a2-cbb4-4e04-b33c-f0211b73352c.jpg" style="position:absolute; left: 0; top: 0;"></a></object>
				</div>
				<section class="widget" id="mostview-widget">
					<header class='widget-header'>
						<h1><a href="#">Chuyên mục: Sao</a></h1>
					</header>
					<div class='widget-content'>
						<?php ap_get_posts('list-layout',array('limit'=>5,'orderby'=>'views','order'=>'DESC','categories'=>'showbiz,giai-tri')); ?>
					</div>
				</section>
			</div>
		</div>
	<?php endif; ?>
<?php get_footer(); ?>
